package com.augrain.microframework.trace.instrument.web;

import com.augrain.microframework.trace.TraceProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * trace追踪web自动装配
 *
 * @author biaoy
 * @since 2021/08/20
 */
@Configuration
@EnableConfigurationProperties(TraceProperty.class)
@ConditionalOnClass(name = {"org.springframework.web.servlet.config.annotation.WebMvcConfigurer"})
public class TraceWebAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public TraceWebConfig traceWebConfig() {
        return new TraceWebConfig();
    }
}
